﻿namespace CSC.FSVTracker.WebUI.Helper
{
    using CSC.FSVTracker.Domain.Entities;
    using CSC.FSVTracker.WebUI.Models;
    /// <summary>
    /// View Model Helper Class.
    /// </summary>
    public static class ViewModelHelper
    {
        /// <summary>
        /// Authenticates the user.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <param name="password">The password.</param>
        /// <returns>Is a valid user</returns>
        public static bool AuthenticateUser(LoginViewModel viewModel, User user)
        {
            if (user == null)
            {
                return false;
            }
            
            EncryptionServices encryptObj = new EncryptionServices();
            return string.Equals(user.Password, encryptObj.base64Encode(viewModel.Password)) ? true : false;
        }
    }
}